import request from '@/config/axios'

// 仓库编号 VO
export interface WarehouseCodeVO {
  id: number // 仓库编号表主键
  warehouseId: number // 关联仓库主键
  name: string // 仓库名称
  code: number // 编号
  sort: number // 排序
  remark: string // 备注
  status: number // 开启状态枚举
}

// 仓库编号 API
export const WarehouseCodeApi = {
  // 查询仓库编号分页
  getWarehouseCodePage: async (params: any) => {
    return await request.get({ url: `/erp/warehouse-code/page`, params })
  },

  // 查询仓库编号详情
  getWarehouseCode: async (id: number) => {
    return await request.get({ url: `/erp/warehouse-code/get?id=` + id })
  },

  // 新增仓库编号
  createWarehouseCode: async (data: WarehouseCodeVO) => {
    return await request.post({ url: `/erp/warehouse-code/create`, data })
  },

  // 修改仓库编号
  updateWarehouseCode: async (data: WarehouseCodeVO) => {
    return await request.put({ url: `/erp/warehouse-code/update`, data })
  },

  // 删除仓库编号
  deleteWarehouseCode: async (id: number) => {
    return await request.delete({ url: `/erp/warehouse-code/delete?id=` + id })
  },

  // 导出仓库编号 Excel
  exportWarehouseCode: async (params) => {
    return await request.download({ url: `/erp/warehouse-code/export-excel`, params })
  },
}
